<template>
  <div id="app" v-touch:right="onSwipeRight" v-touch:left="onSwipeLeft">
    <keep-alive include="Index">
      <router-view>
        <!-- 只有路径匹配到的视图 a 组件会被缓存！ -->
      </router-view>
    </keep-alive>
  </div>
</template>

<style>
  html,body,div,span,h1,h2,h3,h4,h5,h6,ul,ol,li,p {
    margin: 0;
    padding: 0;
  }
  html,body,#app {
    width: 100%;
    height: 100%;
    font-family: "微软雅黑";
  }
  ul,ol {
    list-style: none;
  }
  a {
    text-decoration: none;
  }
</style>

<script>
import Index from './views/Index.vue';
  export default{
  components: { Index },
    methods:{
      // 右滑返回上一页
      onSwipeRight(){
        this.$router.go(-1);
      },
      // 左滑返回下一页
      onSwipeLeft(){
        this.$router.go(1);
      }
    }
  }
</script>
